Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add demo for comparison with libtorch (and pytorch) #1002

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vaithak
Copy link
Collaborator

@vaithak vaithak commented Jul 23, 2024

No description provided.

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link

codecov bot commented Jul 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.80%. Comparing base (f03fc98) to head (6c6dbbf).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1002   +/-   ##
=======================================
  Coverage   93.80%   93.80%           
=======================================
  Files          55       55           
  Lines        8065     8065           
=======================================
  Hits         7565     7565           
  Misses        500      500           

@@ -0,0 +1,10 @@
cmake_minimum_required(VERSION 3.18 FATAL_ERROR)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a bot to run this as part of the CI?

}

// Benchmark the time for 100 matrix multiplications.
void benchmark_matrix_multiply(double x[M + N], double y[M]) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it matters, but shouldn't x's size be [M * N] here?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also y seems to be unused here.

std::mt19937 gen(42);

// Generate random input data and labels.
double x[M * N], y[M];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both of the demos seem to benchmark the multiplication XX, which I believe only makes sense if M=N. Maybe transpose one of them so that it's always valid?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants